home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / progra / mai / Form, tiling a bitmap across < prev    next >
Encoding:
Text File  |  1997-07-15  |  1013 b   |  30 lines

  1. Description: Tiles a bitmap across a form
  2.  
  3. 'Private Declare Function BitBlt Lib "GDI32" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  4.  
  5. Dim maxhgt As Long, maxwid As Long
  6. Dim pwid As Integer, phgt As Integer
  7.  
  8. 'Sub Form_Load ()
  9.     picture1.ScaleMode = 3
  10.         picture1.Visible = False
  11.         picture1.AutoSize = True
  12.         picture1.AutoRedraw = True
  13.         pwid = picture1.ScaleWidth
  14.         phgt = picture1.ScaleHeight 
  15. 'End Sub
  16.  
  17. 'Sub Form_Paint ()
  18.     phDC& = picture1.hDC
  19.         frmhdc& = hdc
  20.     For j% = 0 To maxhgt Step phgt
  21.             For i% = 0 To maxwid Step pwid
  22.                     X% = BitBlt(frmhdc&, i%, j%, pwid, phgt, phDC&, 0, 0, &HCC0020)
  23.                 Next
  24.         Next
  25. 'End Sub
  26.  
  27. 'Sub Form_Resize ()
  28.     maxhgt = Height \ screen.TwipsPerPixelY
  29.         maxwid = Width \ screen.TwipsPerPixelX
  30. 'End Sub